<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>change background Color</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  
  <body>
	<input id="bgc" type="button" value="change background">
	
	<script type="text/javascript">
		//  改变网页的背景色
		var bgc = document.getElementById("bgc");
		bgc.onclick = function(){
			var color = prompt("请输入颜色名称或颜色代码:","");
			changeBgColor(color);
		}
		function changeBgColor(color){
			document.bgColor = color;
		}
	</script>
  </body>
</html>
